home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Bus / M / MouseDroppings Hints.cpt / Mouse Droppings Hints / Mouse Droppings Hint Folder / 1987 Hints / 11_87 MacHypr < prev    next >
Encoding:
Text File  |  1990-11-20  |  7.2 KB  |  144 lines

  1. HyperCard Hints
  2. By Philip C. Russell
  3.  
  4. To keep desk accessories open in Hypercard, use the Windows DA (from BatteryPak), to bring HyperCard's window back to the front.  David Dunham uses his Acta DA to transfer pictures and text from other applications into HyperCard. (Thanks, David Dunham and The Mouse Times, Goleta, CA)
  5.  
  6. Here's a biggie! Everyone has been hollering for a way to toggle between Button tool, Field tool and Browse tool rapidly.
  7. First, the manual tells us we can use Command/Tab to get the browse tool. Aha, but here is a better one. You can toggle between all three tools if you put this into the script of the HyperCard Home stack: 
  8.  
  9. on enterKey
  10.   if the tool is "browse tool"
  11.   then choose button tool
  12.   else if the tool is "button tool"
  13.   then choose field tool
  14.   else choose browse tool
  15. end enterKey
  16. Now the enter key will toggle browse, button, field as fast as you can click the key.
  17. Of course, if you use enter for repeated searches, you might want to modify the script to include the shift key by adding a line:
  18. if the shiftKey is down
  19. (David Dunham and Michael Long in The Mouse Times)
  20.  
  21. HyperCard waits for user response when it encounters a dialog box.  You will have to keep this in mind when programming.
  22.  
  23. Buttons which highlight when the cursor runs across them help novices (and experts, too). Add the following code to the button script:
  24.  
  25. on mouseEnter
  26.   set hilite of the target to true
  27. end mouseEnter
  28.  
  29. on mouseLeave
  30.   set hilite of the target to false
  31. end mouseEnter
  32.  
  33. This works, but you have to write the script into every single button, one at a time. If you try to write this script into the stack, it acts on fields, too -- which is not what you want. So try this for all buttons in a stack to highlight:
  34.  
  35. on mouseEnter
  36.   if "button" is in the target then set hilite of the target to true
  37. end mouseEnter
  38.  
  39. on mouseLeave
  40.   if "button" is in the target then set hilite of the target to false
  41. end mouseLeave
  42. (Thanks to David Moen and Richard Crispin in The Mouse Times)
  43.  
  44. To prohibit people from peeking at your buttons (sounds a bit salacious, huh?), take your user to a special "no peek" card and back again. The no peek card can tell the user that the use of Command/Option is prohibited and return the user to the original card. Here is some script for this move:
  45.  
  46. On Idle
  47.   if the commandkey is down and 
  48.   the optionkey is down then
  49.     push this card
  50.     go card "no peeking"
  51.   end if
  52. end Idle
  53.  
  54. And for the "no peeking" card's script:
  55. On Idle
  56.   if the commandkey is up and
  57.   the optionkey is up then
  58.     pop card
  59.   end if
  60. End Idle
  61.  
  62. Here's a handy idea. Create a button on your Home card with a script that says 
  63. go to stack "the stack you want"
  64.  
  65. When you click on it, not finding a stack by that name will give you a standard dialog box to go get any stack you want.  This is handy when you can't remember the EXACT title you gave a stack.
  66.  
  67. Remember that HyperCard stacks are volatile! Make a COPY of any stack you are going to play with. You may inadvertently change something, and it's nice to have a clean, untouched copy. (Peter Olson in The Mouse Times)
  68.  
  69. Holding down the Shift key while clicking on a button with button tool takes you directly into the script.
  70.  
  71. Never name a button or field starting with a number.  HyperCard will look for a button or card with that number, not for the name incorporating the number.  
  72.  
  73. To speed up "Show all cards" in a stack, write in script for the stack that "on OpenStack" will lock the screen, show all cards and unlock the screen.  This will invisibly show all cards, caching them so that when you use show all cards, it will really whiz bang through them.
  74.  
  75. Mac II owners have to use the monitor in bit 2 mode to see any of the visual effects (barndoor, dissolve, scroll, etc.)
  76.  
  77. Use doMenu to get to any desk accessory or any menu item. Be sure you spell it right in the script. Example: doMenu Choose will not work, but doMenu Chooser will. Punctuation, spaces and spelling are important.
  78.  
  79. You can have a different cursor. Just use the script "Set cursor to x" where "x" is a number of a cursor.  1 is an I-beam, 2 is a crossbar, 3 is a thick crossbar, 4 is the watch and 5 is the arrow or browse tool.
  80.  
  81. Command/Spacebar will bring up (or hide) the Menu bar.
  82.  
  83. To make your Phone Stack dial the * and the #, click on the script, find two instances of the string 0123456789. Change each one to read 0123456789#* and it will now work. (David Fry in The Mouse Times)
  84.  
  85. Option/O shows you what is opaque white and what is not if you are in Paint Tools.
  86.  
  87. To get a miniature picture of a card, use Copy Card from the Edit menu, go to the card you want the miniature on, hold down Command/Shift and type a V. You will get a mini-image of the card. 
  88. Idea: you could have a page full of these with a transparent button over each one to take you to that stack (or card) instantly.
  89.  
  90. Pressing Command/period will stop any script in its tracks.
  91.  
  92. Just like MacWrite, double clicking a word selects the entire word.
  93.  
  94. Drag on text in a field and HyperCard places it in the message box, where you can execute it, if it is "executable."
  95.  
  96. Mouseup, down, within, etc. messages in fields only work when the field text is locked.
  97.  
  98. The characters ≤ and ≥ for greater than or equal and less than or equal work in HyperCard. Get them with Option/< and Option/>.
  99.  
  100. Go screenless with the script: 
  101. set visible of cardwindow to false
  102.  
  103. If a stack has been user-limited, but has no password protection, you can override the limits. Hold down the Command key while you lower the File menu. Guess what? There is the Protect Stack menu item. You can use it to change your user level.
  104.  
  105. If a stack shows only the Browse level, you should first go to the User Preference Card (one before the Home Card) and make sure your desired level is selected. If the author intended you to have that level, it will now be available.
  106.  
  107. If a stack beeps and returns you to the Browse level, do this: Run through a few cards, then use Recent (Command/R) and select one. Select Stack Info... and look at the script. Remove the instruction which keeps going to the User Preference Card to reduce your user level. 
  108.  
  109. If a stack always hides the menu bar, open the stack's script and look for a "hide menubar" entry. Remove it. If you don't find it in the stack script, try the card script(s) until you find it. It's in there somewhere.
  110. Of course you could use Command/spacebar to toggle the menu bar on and off each time you need it or want to hide it.
  111.  
  112. Here's a neat script to move selected objects from a card to the Background quickly:
  113.  
  114. on functionkey whatkey
  115.   if whatkey is 6 then
  116.     type "x" with commandkey -- cut whatever is selected
  117.     doMenu "background" -- enter the background
  118.     type "v" with commandkey -- paste it
  119.     doMenu "background" -- leave the background
  120.   else 
  121.     pass functionkey 
  122.   end if
  123. end function keys
  124.  
  125. Here is another way:
  126.  
  127. on mouseUp
  128.   choose select tool
  129.   click at 120,100 -- selects upper left corner of image
  130.   drag from 120,100 to 350,200 -- draws marquee to select an object
  131.   type "x" with commandkey -- cut
  132.   doMenu "background" -- goes to background layer
  133.   type "v" with commandkey -- pastes
  134.   doMenu "background" -- returns to card layer
  135. end mouseUp
  136.  
  137.  
  138. Submitted for publication at your usual rates:
  139.  
  140. Philip C. Russell
  141. 1420 SW Crest Circle
  142. Waldport, OR 97394
  143. (503)563-2501
  144.